home *** CD-ROM | disk | FTP | other *** search
- Date: Fri, 17 Feb 89 16:05:58 +0100
- From: (anonynmous)
- Subject: An MS-Kermit logging package
-
- While using MSKermit scripts (with pleasure) I discovered that some
- tricks can provide a logging package with a structure some might like. I
- include a skeleton of my development below for your database, if you like.
- But I'd prefer it From: Anonymous.
-
- In the course of writing a rather general logging package with MSKermit
- for our users, I tried to confine all the parameters he has to modify in a
- single file and to limit the number of files to the minimum, while still
- preserving modularity. I came to a solution that, at the expense of a
- naughty trick, can gather both DOS and Kermit user-controllable parameters
- and even code. According to the presence/absence of the parameters, the
- package makes its way through all the paths they relate to. At the end,
- there is provision for anything the user wishes, be it CONNECT or RUN
- his-process with retry.
-
- The final general syntax is CALLHOST [LOG] (the CONLOG file being for
- problem support). Shorter files are distributed for the most common paths.
- Remember one has to double %'s in DOS batch files when they are not intended
- for parameters or variables.
-
- The abridged CALLHOST.BAT file goes:
-
- @ECHO OFF
- GOTO %%DOS
- :%%DOS ; Kermit parameters, really. Update them with your own.
- define \%B 19200 ; Baud rate
- define \%R 3 ; Global retry count
- define \%N ATDPW0WT562900 ; Hayes dialing command if modem
- ... and several other such path parameters ...
- Note: we could have any Kermit code, even:
- if defined \%? goto PART_2 ; for multiple threads.
- define \%U VM-userid ; if Logon wanted
- define \%P password ; optional, or may be "@CON"
- define \%X CONNECT ; Kermit command to execute if success
- comment define \%Y your-job ; DOS procedure to \%X=RUN if success
- comment define \%Z its-parms ; its parameters
- pop ; End of Kermit parameters
- :%DOS
- ECHO OFF
- KERMIT -F CALLHOST.KER, PROCESS %0.BAT %1 >CON%1
- IF NOT ERRORLEVEL 1 REM any more DOS
-
- And the abridged CALLHOST.KER goes:
-
- if not defined PROCESS define PROCESS take CALLHOST.KER ; 1st time in
- if not defined \%1 pop ; 1st time done
-
- if defined \%2 set take-echo on ; logging file present
-
- define @ECHO comment nooped DOS command
- take \%1 ; parameters file
- define @ECHO
-
- if not defined \%C define \%C 1
- if not defined \%B define \%B 1200
- if not defined \%R define \%R 1
- set port COM\%C
- set speed \%B
- etc...
-
- set count \%R
- goto AGAIN
- :RETRY
- if not count goto DONE
- echo Reprise g)n)rale\13
- :AGAIN
- set errorlevel 0
- set handshake none
- set flow-control none
- set local-echo off
-
- if defined \%N take callrtt.ker ; phone call
- if errorlevel 1 goto RETRY
-
- and one such for each path ...
-
- if defined \%U take callvm.ker ; VM logon
- if errorlevel 1 goto RETRY
-
- if defined \%X \%X \%Y \%Z ; possible user process
- if errorlevel 1 goto RETRY
-
- :DONE
-
-